<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin think\Model
 */
class Nb extends Model
{
    //
    protected $table="goods";
    protected $pk="goods_id";
    protected $schema = [
        'goods_id'          => 'int',
        'goods_name'        => 'string',
        'goods_type'        => 'string',
        'store_count'        => 'string',
        'is_show'        => 'string',
        'is_hot'        => 'string',
    ];
    //分页展示
    public function getPage(){
        return self::paginate(2);
    }
    //添加
    public function getAdd($data){
        return self::create($data);
    }
    //删除
    public function delOne($id){
        return self::where('goods_id',$id)->delete();
    }
    //修改
    public function upOne($id,$data){
        return self::where('goods_id',$id)->update($data);
    }
}
